﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IOEntity;
using IOBusiness;
namespace IOWeb.Admin
{
    public partial class Login1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.lblMessage.Text = "";
            this.txtUserName.Focus();
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                clsBSAdmin obj = new clsBSAdmin();
                clsAdmin clss = new clsAdmin();
                clss = obj.GetByUserPassword(this.txtUserName.Text, this.txtPassword.Text);
                if (clss != null)
                {
                    Session["AdminID"] = clss.Id;
                    Response.Redirect("~/Admin/Default.aspx");
                }
                else
                {
                    this.lblMessage.Text = "Đăng nhập không thành công";
                }
            }
            catch (Exception)
            {
                
                throw;
            }
        }
    }
}